|
forcecell 2.2.0
|
API for configuring and manipulating Force Cell Click driver. More...
Topics | |
| Force Cell Settings | |
| Settings of Force Cell Click driver. | |
| Force Cell MikroBUS Map | |
| MikroBUS pin mapping of Force Cell Click driver. | |
Functions | |
| void | forcecell_cfg_setup (forcecell_cfg_t *cfg) |
| Force Cell configuration object setup function. | |
| void | forcecell_drv_interface_sel (forcecell_cfg_t *cfg, forcecell_drv_t drv_sel) |
| Force Cell driver interface setup function. | |
| err_t | forcecell_init (forcecell_t *ctx, forcecell_cfg_t *cfg) |
| Force Cell initialization function. | |
| err_t | forcecell_read_raw_adc (forcecell_t *ctx, uint16_t *raw_adc) |
| Force Cell read raw ADC value function. | |
| err_t | forcecell_read_voltage (forcecell_t *ctx, float *voltage) |
| Force Cell read voltage level function. | |
| err_t | forcecell_read_voltage_avg (forcecell_t *ctx, uint16_t num_conv, float *voltage_avg) |
| Force Cell read average voltage level function. | |
| err_t | forcecell_set_vref (forcecell_t *ctx, float vref) |
| Force Cell set vref function. | |
| err_t | forcecell_calib_offset (forcecell_t *ctx) |
| Force Cell calib offset function. | |
| err_t | forcecell_read_force (forcecell_t *ctx, float *force) |
| Force Cell read force function. | |
API for configuring and manipulating Force Cell Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| err_t forcecell_calib_offset | ( | forcecell_t * | ctx | ) |
Force Cell calib offset function.
This function calibrates the zero force offset value.
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void forcecell_cfg_setup | ( | forcecell_cfg_t * | cfg | ) |
Force Cell configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See forcecell_cfg_t object definition for detailed explanation. |
| void forcecell_drv_interface_sel | ( | forcecell_cfg_t * | cfg, |
| forcecell_drv_t | drv_sel ) |
Force Cell driver interface setup function.
This function sets a serial driver interface which will be used further in the Click driver.
| [out] | cfg | : Click configuration structure. See forcecell_cfg_t object definition for detailed explanation. |
| [in] | drv_sel | : Driver interface selection. See forcecell_drv_t object definition for detailed explanation. |
| err_t forcecell_init | ( | forcecell_t * | ctx, |
| forcecell_cfg_t * | cfg ) |
Force Cell initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See forcecell_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t forcecell_read_force | ( | forcecell_t * | ctx, |
| float * | force ) |
Force Cell read force function.
This function reads the applied force level [N].
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [out] | force | : Applied force level [N]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t forcecell_read_raw_adc | ( | forcecell_t * | ctx, |
| uint16_t * | raw_adc ) |
Force Cell read raw ADC value function.
This function reads raw ADC value.
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [out] | raw_adc | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t forcecell_read_voltage | ( | forcecell_t * | ctx, |
| float * | voltage ) |
Force Cell read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [out] | voltage | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t forcecell_read_voltage_avg | ( | forcecell_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | voltage_avg ) |
Force Cell read average voltage level function.
This function reads a desired number of ADC samples and calculates the average voltage level.
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | voltage_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t forcecell_set_vref | ( | forcecell_t * | ctx, |
| float | vref ) |
Force Cell set vref function.
This function sets the voltage reference for Force Cell Click driver.
| [in] | ctx | : Click context object. See forcecell_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.